<template>
    <div>
        <h1>{{this.name}}</h1>
        <el-button type="primary" @click="clickBtn">点击刷新</el-button>
    </div>
</template>
<script>
export default {
    inject:["reload"],
    data(){
        return{
            name:''
        }
    },
    mounted(){
        setTimeout(() => {
            this.name = "componentRefreshChild"
        },2000)
    },
    methods:{
        clickBtn(){
            this.reload()
        }
    }
}
</script>